package com.zoo.diannaopeijian.service.impl;

import com.zoo.diannaopeijian.comm.page.Page;
import com.zoo.diannaopeijian.domain.ExportItem;
import com.zoo.diannaopeijian.domain.ExportRecord;
import com.zoo.diannaopeijian.mapper.ExportRecordMapper;
import com.zoo.diannaopeijian.service.ExportRecordService;
import com.zoo.diannaopeijian.service.ExportService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created by zx583 on 2018-01-30.
 */
@Service
public class ExportRecordServiceImpl implements ExportRecordService {
    @Resource
    private ExportRecordMapper exportRecordMapper;

    @Override
    public boolean insertExportRecord(ExportRecord exportRecord) {
        return exportRecordMapper.insertSelective(exportRecord) == 1;
    }

    @Override
    public List getExportRecord(Date from, Date to, String staffname) {
        return exportRecordMapper.getExportRecord(from, to, staffname);
    }

    @Override
    public List getExportRecordWithPage(Date from, Date to, String staffname, Page page) {
        if (page != null) {
            page.onPage();
        }

        return getExportRecord(from, to, staffname);
    }
}
